﻿//-----------------------------------------------------------------------
// <copyright file="IChatEngine.cs" company="AFS">
// Copyright (c) AFS. All rights reserved.
//
//    This file is part of Chatbox.
//
//    Chatbox is free software: you can redistribute it and/or modify
//    it under the terms of the GNU Lesser General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    any later version.
//
//    Chatbox is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//    GNU Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public License
//    along with Chatbox. If not, see http://www.gnu.org/copyleft/lesser.html
// </copyright>
//----------------------------------------------------------------------- 

namespace ChatBox.Interfaces
{
    using System;
    using System.Collections.Generic;

    using ChatBox.DomainObjects.ResultData;
    using ChatBox.DomainObjects.XmlFeedObjects;
    using ChatBox.Utility;

    /// <summary>
    /// Interface to chat engine
    /// </summary>
    public interface IChatEngine
    {
        /// <summary>
        /// Notifiation that the title has changed
        /// </summary>
        event EventHandler TopicChanged;

        /// <summary>
        /// notification that public messages have been received
        /// </summary>
        event EventHandler PublicMessagesReceived;

        /// <summary>
        /// Notification that private messages have been received
        /// </summary>
        event EventHandler PrivateMessagesReceived;

        /// <summary>
        /// Notification that an updated version has been received
        /// </summary>
        event EventHandler<EventArgs<ClientVersion>> UpdatedVersionReceived;

        /// <summary>
        /// Notification of any result from the services
        /// </summary>
        event EventHandler<EventArgs<OperationResult>> OperationCompleted;

        /// <summary>
        /// Gets the public chat data source
        /// </summary>
        IPublicChatDataSource PublicChatDataSource
        {
            get;
        }

        /// <summary>
        /// Gets the private chat data source
        /// </summary>
        IPrivateChatDataSource PrivateChatDataSource
        {
            get;
        }

        /// <summary>
        /// Gets the new writeups data source
        /// </summary>
        INewWriteupsSource NewWriteupsSource
        {
            get;
        }

        /// <summary>
        /// Gets the cool nodes data source
        /// </summary>
        ICoolNodesSource CoolNodesSource
        {
            get;
        }

        /// <summary>
        /// Gets the editor cools data source
        /// </summary>
        IEditorCoolsSource EditorCoolsSource
        {
            get;
        }

        /// <summary>
        /// Gets the other users data source
        /// </summary>
        IOtherUsersSource OtherUsersSource
        {
            get;
        }

        /// <summary>
        /// Gets the message deleter
        /// </summary>
        IMessageDelete MessageDelete
        {
            get;
        }

        /// <summary>
        /// Gets the logger
        /// </summary>
        ILogger Logger
        {
            get;
        }

        /// <summary>
        /// Gets the public chat messages
        /// </summary>
        IList<Message> PublicChatMessages
        {
            get;
        }

        /// <summary>
        /// Gets the private chat messages
        /// </summary>
        IList<Message> PrivateChatMessages
        {
            get;
        }

        /// <summary>
        /// Gets the other users
        /// </summary>
        IList<OtherUser> OtherUsers
        {
            get;
        }

        /// <summary>
        /// Gets the chat topic
        /// </summary>
        string Topic
        {
            get;
        }

        /// <summary>
        /// Gets a value indicating whether the user is logged on 
        /// </summary>
        bool IsLoggedOn
        {
            get;
        }

        /// <summary>
        /// Start reading public data
        /// </summary>
        void StartPublic();

        /// <summary>
        /// Start the log on 
        /// </summary>
        void LogOn();

        /// <summary>
        /// Start reading private messages
        /// </summary>
        void StartPrivate();

        /// <summary>
        /// Start the tickers
        /// </summary>
        void StartTickers();
    }
}
